
from django.urls import path
from .views import *

urlpatterns = [

    # 用户管理
    path('login/', UserView.as_view({'post':'login'})),
    path('register/', UserView.as_view({'post':'register'})),
    path('userinfos/', UserView.as_view({'get':'usershow','put':'forget_pwd'})),
    path('userinfo/', UserView.as_view({'get':'user_desc','put':'upd_user'})),

    path('image/',UserView.as_view({'get':'image_code'})),

    # 职级管理
    path('ranks/', RankView.as_view({'get':'rankshow','post':'add_rank'})),
    path('rank/<int:pk>/', RankView.as_view({'put':'upd_rank','delete':'del_rank'})),

    # 部门管理
    path('sections/', SectionView.as_view({'get':'sectionshow','post':'add_section'})),
    path('section/<int:pk>/', SectionView.as_view({'put':'upd_section','delete':'del_section'})),

    # 职位管理
    path('stations/', StationView.as_view({'get':'stationshow','post':'add_station'})),
    path('station/<int:pk>/', StationView.as_view({'put':'upd_station','delete':'del_station'})),

    # 获取所有菜单信息
    path('menus/', MenuView.as_view({'get':'menu_desc'})),
    # 获取用户菜单
    path('menu/', MenuView.as_view({'get':'menushow'})),

    # 获取所有操作信息
    path('handles/', HandleView.as_view({'get':'handleshow'})),

    # 首页数据
    path('user_date/', IndexView.as_view({'get':'user_date'})),
    path('user_address/', IndexView.as_view({'get':'user_address'})),
    path('user_birthday/', IndexView.as_view({'get':'user_birthday'})),

    # 发送邮件
    path('mails/', MailView.as_view({'get':'mailshow', 'post':'sendmail'})),
    # 获取垃圾箱数据
    path('mail/', MailView.as_view({'get':'dustbinshow'})),
    # 逻辑删除
    path('mails/<int:pk>/', MailView.as_view({'delete':'del_mail'})),
    # 彻底删除
    path('mail/<int:pk>/', MailView.as_view({'delete':'thorough_del'})),
]
